<include file="public/layout" />

<body style="background-color: rgb(255, 255, 255); overflow: auto; cursor: default;">
	<div class="page">
		<div class="fixed-bar">
			<div class="item-title">
				<div class="subject">
					<h3>评论管理</h3>
					<h5>讨论区帖子评论审核与管理</h5>
				</div>
			</div>
		</div>
		<div id="explanation" class="explanation">
			<div id="checkZoom" class="title"><i class="fa fa-lightbulb-o"></i>
				<h4 title="提示相关设置操作时应注意的要点">操作提示</h4>
				<span title="收起提示" id="explanationZoom"></span>
			</div>
			<ul>
				<li>请不要误删除帖子内容，不可恢复</li>
			</ul>
		</div>
		<form method="post">
			<input type="hidden" value="ok" name="form_submit">
			<div class="flexigrid">
				<div class="mDiv">
					<div class="ftitle">
						<h3>评论管理</h3>
						<h5></h5>
					</div>
				</div>
				<div class="hDiv">
					<div class="hDivBox">
						<table cellspacing="0" cellpadding="0" class="flex-table autoht">
							<thead>
								<tr>
									<th align="center" axis="co5" class="sign">
										<div style="width: 24px;"><i class="ico-check"></i></div>
									</th>
									<th  axis="co5" >
										<div style="width: 24px;">ID</div>
									</th>
									<th  axis="col3" >
										<div style="width: 350px;">内容</div>
									</th>
									<th  axis="col3">
										<div style=" width: 150px;">评论时间</div>
									</th>
									<th  axis="col3">
										<div style=" width: 150px;">评论人</div>
									</th>
									<th  axis="col3">
										<div style=" width: 100px;">状态</div>
									</th>
									<th  axis="col3">
										<div style=" width: 102px;">操作</div>
									</th>
								</tr>
							</thead>
						</table>
					</div>
				</div>
				<div style="height: auto;" class="bDiv">
					<table cellspacing="0" cellpadding="0" border="0" id="article_cat_table" class="flex-table autoht" style="width: auto;">
						<tbody>
							<foreach name="lists" item="vo" key="k" >
							<tr>
							<td class="sign" axis="co5">
								<div style="width: 24px;"><i class="ico-check"></i></div>
							</td>
							<td class="sign" axis="co5">
								<div style="width: 24px;">{$vo.id}</div>
							</td>
							<td align="left" abbr="order_sn" axis="col3" class="" >
								<div style=" width: 350px;" class="">{$vo.content}</div>
							</td>
							<td align="left" abbr="order_sn" axis="col3" class="" >
								<div style=" width: 150px;" class="">{$vo.addtime|date="Y-m-d H:i:s",###}</div>
							</td>
							<td align="left" abbr="order_sn" axis="col3" class="" >
								<div style=" width: 150px;" class="">{$vo.user.nickname}</div>
							</td>
							<td align="left" abbr="order_sn" axis="col3" class="" >
								<div style=" width: 100px;" class="">{$status[$vo.status]}</div>
							</td>
							<td class="handle">
                				<div style=" width: 102px;"">
                  					<span class="btn"><em><i class="fa fa-cog"></i>操作<i class="arrow"></i></em>
                  					<ul>
                    					<li><a href="javascript:del('{:U('Discuss/doReply',array('id'=>$vo.id,'act'=>'success'))}')">审核</a></li> 
                    					<li><a href="javascript:del('{:U('Discuss/doReply',array('id'=>$vo.id,'act'=>'close'))}')">关闭</a></li> 
                    					<li><a href="javascript:del('{:U('Discuss/doReply',array('id'=>$vo.id,'act'=>'del'))}')">删除</a></li>
                  					</ul>
                  					</span>
                				</div>
              				</td>
							</tr>
							<if $vo.lists>
							<tr>
								<table style="margin-left: 40px; width: auto; background: #F0F0F0;">
									<foreach name="vo.lists" item="v" key="k2">
									<tr>
										<td class="sign" axis="co5">
											<div style="width: 24px;">{$v.id}</div>
										</td>
										<td align="left" abbr="order_sn" axis="col3" class="" >
											<div style=" width: 350px;" class="">{$v.content}</div>
										</td>
										<td align="left" abbr="order_sn" axis="col3" class="" >
											<div style=" width: 150px;" class="">{$v.addtime|date="Y-m-d H:i:s",###}</div>
										</td>
										<td align="left" abbr="order_sn" axis="col3" class="" >
											<div style=" width: 150px;" class="">{$v.user.nickname}</div>
										</td>
										<td align="left" abbr="order_sn" axis="col3" class="" >
											<div style=" width: 100px;" class="">{$status[$v.status]}</div>
										</td>
										<td class="handle">
			                				<div style=" width: 102px;"">
			                  					<span class="btn"><em><i class="fa fa-cog"></i>操作<i class="arrow"></i></em>
			                  					<ul>
			                    					<li><a href="javascript:del('{:U('Discuss/doReply',array('id'=>$v.id,'act'=>'success'))}')">审核</a></li> 
			                    					<li><a href="javascript:del('{:U('Discuss/doReply',array('id'=>$v.id,'act'=>'close'))}')">关闭</a></li> 
			                    					<li><a href="javascript:del('{:U('Discuss/doReply',array('id'=>$v.id,'act'=>'del'))}')">删除</a></li>
			                  					</ul>
			                  					</span>
			                				</div>
			              				</td>
								    </tr>
								    </foreach>
							    </table>
							</tr>	
							</if>
							</foreach>
						</tbody>
					</table>
				</div>
			</div>
	</div>
	<script>
		$(document).ready(function() {
			// 表格行点击选中切换
			$('.bDiv > table>tbody >tr').click(function() {
				$(this).toggleClass('trSelected');
			});
		});

		// 点击展开 收缩节点
		function treeClicked(obj, cat_id, parent_id_path) {

			var src = $(obj).attr('src');
			if(src == '/public/static/images/tv-expandable.gif') {
				$(".parent_id_" + cat_id).show();
				$(obj).attr('src', '/public/static/images/tv-collapsable-last.gif');
			} else {
				$("tr[parent_id_path^='" + parent_id_path + "_']").hide().find('img').attr('src', '/public/static/images/tv-expandable.gif');
				$(obj).attr('src', '/public/static/images/tv-expandable.gif');

			}
		}
		
		function del(del_url)
		{
		    if(confirm("确定要执行此操作吗?")){
		        $.post(del_url,function(result){
			        var obj = $.parseJSON(result);
			        if(obj.status == -1){
			            alert(obj.msg);
			            return false;
			        }
			        if(obj.status == 1){
			            if(obj.data.return_url){
			                //  返回跳转链接
			                location.href = obj.data.return_url;
			            }else{
			                //  刷新页面
			                location.reload();
			            }
			            return;
			        }
			    })
		    }    
		} 
	</script>
</body>

</html>